<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>javascript 阶段</title>
</head>
<body>


    <script>
        function App(distance , speed_1 , speed_2) {
            this.distance = distance || 1000 ;
            this.speed_1 = speed_1 || 60 ;
            this.speed_2 = speed_2 || 40 ;
        }
        App.prototype.walk = function () {
            this.speed = this.speed_1 + this.speed_2 ;
            console.log(this.speed + "m/min");
            // console.log((this.speed *60) + "m/second");
            var time_1 = "";
            time_1 = this.distance / this.speed;
            console.log(time_1+"分钟");
            console.log((time_1 * 60) + "秒");
        }

        var a1 = new App (1000 , 30 , 20);
        var time = a1.walk();
    </script>
</body>
</html>